<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动态绑定外部样式类——对象语法</title>
    <style>
        .active {
            background-color: chocolate;
        }

        .line {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="app">
    <!--对象语法：使用 Javascript 中的对象形式进行赋值-->
    <!--  对象格式：{样式类1: 布尔类型1,样式类2: 布尔类型2... }  -->
    <!--可以使用 vue devtools 进行控制-->
    <h1 v-bind:class="{active: isActive, line : isLine}">Hello, Vue</h1>
    <h1 v-bind:class="status">Hello, Vue</h1>
    <h1 v-bind:class="stat">Hello, Vue</h1>

</div>

<script type="module">
    import {createApp, ref, reactive} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let isActive = ref(true)
                let isLine = ref(true)
                let status = reactive({active: isActive, line : isLine})
                let stat = {active: isActive, line : isLine}

                return {
                    isActive, isLine,
                    status,
                    stat,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>